{% extends 'base_main.html' %}
{% load static %}
{% block ext_css %}
    {{ block.super }}
    <link rel="stylesheet" href="{% static 'axf/main/css/market.css' %}">
{% endblock %}

{% block ext_js %}
    {{ block.super }}
    <script type="text/javascript" src="{% static 'axf/main/js/market.js' %}"></script>
{% endblock %}

{% block content %}
    <div id="market">
        {# 左侧大的类型导航 #}
        <aside>
            <ul>
                {% for foodtype in foodtypes %}
                    <li>
                        <a href="{% url 'app:market_with_params' typeid=foodtype.typeid childcid=0 order_rule=0 %}">{{ foodtype.typename }}</a>
                        {% ifequal foodtype.typeid typeid %}
                            <span class="yellowSlide"></span>
                        {% endifequal %}
                    </li>
                {% endfor %}
            </ul>
        </aside>


        <section>
            <nav>
                <ul>
                    <li id="all_types"><span>全部分类<span class="glyphicon glyphicon-chevron-down"></span></span></li>
                    <li id="sort_rule"><span>综合排序<span class="glyphicon glyphicon-chevron-down"></span></span></li>
                </ul>
            </nav>
            <menu>
                <ul>
                    {% for goods in goods_list %}
                        <li>
                            <a href="#">
                                <img src="{{ goods.productimg }}" alt="{{ goods.productlongname }}">
                                <div class="shoppingInfo">
                                    <h6>{{ goods.productlongname }}</h6>
                                    <p class="detailTag">
                                        <span>精选</span>
                                        <span></span>
                                        <span>{{ goods.specifics }}</span>
                                    </p>
                                    {#  <p class="unit">{{ goods.specifics }}</p>#}
                                    <p class="price">
                                        <span>{{ goods.price }}</span>
                                        <s>{{ goods.marketprice }}</s>
                                    </p>
                                </div>
                            </a>
                            <section>
                                <button class="subShopping">－</button>
                                <span>0</span>
                                <button goodsid="{{ goods.id }}" class="addShopping">+</button>
                            </section>
                        </li>

                    {% endfor %}

                </ul>
                <div id="all_types_container">
                    <div>
                        {% for foodtype_childnames in foodtype_childnames_list %}
                            {% ifequal foodtype_childnames.1 childcid %}
                                <a href="{% url 'app:market_with_params' typeid=typeid childcid=foodtype_childnames.1 order_rule=0 %}">
                                    <button class="btn btn-success ">{{ foodtype_childnames.0 }}</button>
                                </a>
                            {% else %}
                                <a href="{% url 'app:market_with_params' typeid=typeid childcid=foodtype_childnames.1 order_rule=0 %}">
                                    <button class="btn btn-default ">{{ foodtype_childnames.0 }}</button>
                                </a>
                            {% endifequal %}
                        {% endfor %}

                    </div>
                </div>

                <div id="sort_rule_container">
                    <div>
                        {% for order_rule in order_rule_list %}
                            {% ifequal order_rule_view order_rule.1 %}
                                <a href="{% url 'app:market_with_params' typeid=typeid childcid=childcid order_rule=order_rule.1 %}">
                                    <button class="btn btn-success">{{ order_rule.0 }}</button>
                                </a>
                            {% else %}
                                <a href="{% url 'app:market_with_params' typeid=typeid childcid=childcid order_rule=order_rule.1 %}">
                                    <button class="btn btn-default">{{ order_rule.0 }}</button>
                                </a>
                            {% endifequal %}

                        {% endfor %}


                    </div>
                </div>

            </menu>
        </section>

    </div>
{% endblock %}